import request from '@/utils/request.js'
// 获取-文章分类
export const cateListServer = () => {
  return request.get('/my/cate/list')
}
// 增加-文章分类
export const addCateServer = obj => {
  return request.post('/my/cate/add', {
    ...obj
  })
}
// 编辑-文章分类
export const editCateServer = obj => {
  return request.put('/my/cate/info', {
    ...obj
  })
}
// 删除-文章分类
export const deleteCateServer = id => {
  return request.delete('/my/cate/del', {
    params: {
      id
    }
  })
}

// 获取-文章列表
export const getArticleListServer = obj => {
  return request.get('/my/article/list', {
    params: {
      ...obj
    }
  })
}
// 发布-文章
export const addArticleServer = obj => {
  return request.post('/my/article/add', obj)
}

// 获取-文章详情
export const getArticleDetailServer = id => {
  return request.get('/my/article/info', {
    params: {
      id
    }
  })
}
// 更新-文章详情
export const updateArticleDetailServer = data => {
  return request.put('/my/article/info', data)
}

// 删除-文章
export const deleteArticleServer = id => {
  return request.delete('/my/article/info', {
    params: {
      id
    }
  })
}
